<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<LCA.Community.Web.Models.UserViewModel>" %>
<%@ Import Namespace="LCA.Community.DAL.Model" %>
<%@ Import Namespace="Microsoft.Web.Mvc" %>

<asp:Content ID="Content2" ContentPlaceHolderID="HeaderContent" runat="server">
    <script src="<%= Url.Content("~/Scripts/MicrosoftAjax.js") %>" type="text/javascript"></script>
    <script src="<%= Url.Content("~/Scripts/MicrosoftMvcAjax.js") %>" type="text/javascript"></script>
    <script type="text/javascript">
        function beginAnimation() {
            $('#loading').show();
        }

        function completeAnimation() {
            $('#loading').hide();
        }
    </script>   
</asp:Content>


<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">
    <div class="content-main">
        <h2><img src="<%= Url.Content("~/Content/images/FinalDesign/Icons/users24.png") %>" />Grupos de <%= Model.ID %></h2>
        <%using (Ajax.BeginForm("LeaveGroups", "Group", new { userID = Model.ID }, new AjaxOptions { InsertionMode = InsertionMode.Replace, UpdateTargetId = "groups", OnBegin = "beginAnimation", OnComplete = "completeAnimation" })){ %>
            <%= Html.SubmitImage("usersRemove", Url.Content("~/Content/images/FinalDesign/Icons/users_remove32.png"), new { alt = "Eliminar grupos", style = "display:inline;" })%>
            <img width="24px" id="loading" src="<%= Url.Content("~/Content/images/LCA_logo_rotor.gif") %>" alt="Cargando..." style="display:none;vertical-align:text-bottom;" />
            <div id="groups" class="list">
            <% Html.RenderPartial("ShowUserGroups", Model.Groups); %>
            </div>
        <%} %>
    </div>
    
    <div class="content-right">
        <% Html.RenderPartial("UserMenu",Model.User); %>
    </div>

</asp:Content>